package com.ruoyi.jypc.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.jypc.mapper.BuildingMapper;
import com.ruoyi.jypc.domain.Building;
import com.ruoyi.jypc.service.IBuildingService;

/**
 * 楼栋Service业务层处理
 * 
 * @author wxm
 * @date 2022-10-26
 */
@Service
public class BuildingServiceImpl implements IBuildingService 
{
    @Autowired
    private BuildingMapper buildingMapper;

    /**
     * 查询楼栋
     * 
     * @param buildingid 楼栋主键
     * @return 楼栋
     */
    @Override
    public Building selectBuildingByBuildingid(Long buildingid)
    {
        return buildingMapper.selectBuildingByBuildingid(buildingid);
    }

    /**
     * 根据楼栋名称查询楼栋
     * @param buildingname
     * @return
     */
    public Building selectBuildingByBuildingname(Long buildingname) 
    {
    	return buildingMapper.selectBuildingByBuildingname(buildingname);
    }
    
    /**
     * 查询楼栋列表
     * 
     * @param building 楼栋
     * @return 楼栋
     */
    @Override
    public List<Building> selectBuildingList(Building building)
    {
        return buildingMapper.selectBuildingList(building);
    }
    
    /**
     * 查询楼栋列表
     * 
     * @return 楼栋集合
     */
    @Override
    public List<Building> selectBuildingListAll()
    {
    	return buildingMapper.selectBuildingListAll();
    }

    /**
     * 新增楼栋
     * 
     * @param building 楼栋
     * @return 结果
     */
    @Override
    public int insertBuilding(Building building)
    {
        building.setCreateTime(DateUtils.getNowDate());
        return buildingMapper.insertBuilding(building);
    }

    /**
     * 修改楼栋
     * 
     * @param building 楼栋
     * @return 结果
     */
    @Override
    public int updateBuilding(Building building)
    {
        building.setUpdateTime(DateUtils.getNowDate());
        return buildingMapper.updateBuilding(building);
    }

    /**
     * 批量删除楼栋
     * 
     * @param buildingids 需要删除的楼栋主键
     * @return 结果
     */
    @Override
    public int deleteBuildingByBuildingids(Long[] buildingids)
    {
        return buildingMapper.deleteBuildingByBuildingids(buildingids);
    }

    /**
     * 删除楼栋信息
     * 
     * @param buildingid 楼栋主键
     * @return 结果
     */
    @Override
    public int deleteBuildingByBuildingid(Long buildingid)
    {
        return buildingMapper.deleteBuildingByBuildingid(buildingid);
    }
}
